home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / eflibpt4.zip / DEMO / TESTING / DATA1.PAS < prev    next >
Pascal/Delphi Source File  |  1996-08-16  |  1KB  |  46 lines

  1. { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
  2.   Testing; data elements
  3.  
  4.   EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
  5.   MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
  6.   ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED.                          }
  7.  
  8.  
  9. uses EFLIBDAT;
  10.  
  11.  
  12. var Element1, Element2 : GenericLinkageObjectPointerType;
  13.     Data1 : string[100]; Data2, Data3 : string[200];
  14.  
  15.  
  16. begin
  17.      Data1 := '1) Some data to store in the element.';
  18.      Data2 := '2) Some other data to update the element with.';
  19.      Data3 := '3) Not functioning properly!';
  20.  
  21.  
  22.      New (Element1, InitializeEmpty);
  23.      System.Dispose (Element1, Intercept);
  24.  
  25.      New (Element1, Initialize (Data1, SizeOf(Data1)));
  26.      with Element1^ do begin
  27.           Element (Data1);
  28.           WriteLn (Data1);
  29.  
  30.           Update (Data2, SizeOf(Data2));
  31.           Element (Data1);
  32.           WriteLn (Data1);
  33.  
  34.           if IsAllocated then begin
  35.              New (Element2, InitializeDuplicate (Element1));
  36.              if not IsCompatible(Element2) then
  37.                 WriteLn ('Element compatiblity check failed.');
  38.              with Element2^ do begin
  39.                   Element (Data3);
  40.                   WriteLn (Data3);
  41.              end;
  42.             System.Dispose (Element2, Intercept);
  43.           end;
  44.      end;
  45.      System.Dispose (Element1, Intercept);
  46. end.